﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zad3
{
    class Student
    {
        private string firstname;
        private string lastName;

        public Student(string first, string last)
        {
            this.firstname = first;
            this.lastName = last;
        }

        public string Firstname
        {
            get
            {
                return this.firstname;
            }
        }

        public string LastName
        {
            get
            {
                return this.lastName;
            }
        }

        public override string ToString()
        {
            return string.Format("{0} {1}", this.Firstname, this.LastName);
        }
    }
    class Program
    {
        static void Main()
        {
            Student[] collection = { new Student("Andrey","Kamenov"), new Student("Andrey","Andreev"), new Student("Momchil","Namenov") };
            var allStudentsFurstLessThanlast =
                from student in collection
                where student.Firstname.CompareTo(student.LastName) < 0
                select student;
            foreach (var item in allStudentsFurstLessThanlast)
            {
                Console.WriteLine(item);
            }
        }
    }
}
